import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { ResumeVO, ResumeForm, ResumeQuery } from '@/api/system/resume/types';

/**
 * 查询简历信息列表
 * @param query
 * @returns {*}
 */

export const listResume = (query?: ResumeQuery): AxiosPromise<ResumeVO[]> => {
  return request({
    url: '/system/resume/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询简历信息详细
 * @param resumeId
 */
export const getResume = (resumeId: string | number): AxiosPromise<ResumeVO> => {
  return request({
    url: '/system/resume/' + resumeId,
    method: 'get'
  });
};

/**
 * 新增简历信息
 * @param data
 */
export const addResume = (data: ResumeForm) => {
  return request({
    url: '/system/resume',
    method: 'post',
    data: data
  });
};

/**
 * 修改简历信息
 * @param data
 */
export const updateResume = (data: ResumeForm) => {
  return request({
    url: '/system/resume',
    method: 'put',
    data: data
  });
};

/**
 * 删除简历信息
 * @param resumeId
 */
export const delResume = (resumeId: string | number | Array<string | number>) => {
  return request({
    url: '/system/resume/' + resumeId,
    method: 'delete'
  });
};
